<template>
  <div class="/SPUAddNew">
    <el-breadcrumb separator-class="el-icon-arrow-right" style="font-size: 16px;">
      <el-breadcrumb-item :to="{ path: '/sys-admin/index' }">
        <i class="el-icon-s-promotion"></i> 酒店客房后台管理首页
      </el-breadcrumb-item>
      <el-breadcrumb-item>客房管理</el-breadcrumb-item>
      <el-breadcrumb-item>客房详情</el-breadcrumb-item>
    </el-breadcrumb>
    <el-divider></el-divider>
    <span>客房状态：</span>
    <el-select v-model="statusValue" placeholder="请选择">
      <el-option
          v-for="item in options"
          :key="item.statusValue"
          :label="item.label"
          :value="item.statusValue">
      </el-option>
    </el-select>
    <span>&nbsp&nbsp&nbsp&nbsp&nbsp房型：</span>
    <el-select v-model="roomValue" placeholder="请选择">
      <el-option
          v-for="item in options1"
          :key="item.roomValue"
          :label="item.label"
          :value="item.roomValue">
      </el-option>
    </el-select>
    &nbsp&nbsp&nbsp&nbsp&nbsp客房号：
    <el-input v-model="input" style="width:200px " maxlength="3" placeholder="请输入房号"><i
        slot="suffix" class="el-input__icon el-icon-search"></i>
    </el-input>
    <el-button type="primary" style="margin-left: 20px">搜索</el-button>
    <el-button type="info" style="margin-left: 20px">重置</el-button>
    <el-divider></el-divider>
    <!--客房状态设置按键-->
    <div>
      <el-button type="primary"
                 @click="dialogVisible = true"
                 style="margin-right: 10px">入住</el-button>
      <el-dialog
          title="入住登记"
          :visible.sync="dialogVisible"
          width="40%"
          :before-close="handleClose">
        <div>
          <el-form :model="form">
            <el-form-item label="客房号" :label-width="formLabelWidth">
              <el-select v-model="form.number" placeholder="请选择需要修改的客房号">
                <el-option label="101" value="shanghai"></el-option>
                <el-option label="102" value="shanghai"></el-option>
                <el-option label="103" value="shanghai"></el-option>
                <el-option label="104" value="shanghai"></el-option>
                <el-option label="105" value="shanghai"></el-option>
                <el-option label="106" value="shanghai"></el-option>
                <el-option label="107" value="shanghai"></el-option>
                <el-option label="108" value="shanghai"></el-option>
                <el-option label="109" value="shanghai"></el-option>
                <el-option label="110" value="shanghai"></el-option>
                <el-option label="111" value="shanghai"></el-option>
                <el-option label="112" value="shanghai"></el-option>
                <el-option label="113" value="shanghai"></el-option>
                <el-option label="114" value="shanghai"></el-option>
                <el-option label="115" value="shanghai"></el-option>
                <el-option label="116" value="shanghai"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="客房类型" :label-width="formLabelWidth">
              <el-select v-model="form.type" placeholder="请选择客房类型">
                <el-option v-for="i in roomTypeArr" :value="i.type">{{i.type}}</el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="身份证" :label-width="formLabelWidth">
              <el-input placeholder="请输入身份证号" style="width: 300px;">
                <i slot="prefix" class="el-icon-postcard"
                   style="font-size: 25px"></i>
              </el-input>
            </el-form-item>
            <el-form-item label="姓名" :label-width="formLabelWidth">
              <el-input placeholder="请输入姓名"  style="width: 300px;"></el-input>
            </el-form-item>
            <el-form-item label="手机号码" :label-width="formLabelWidth">
              <el-input placeholder="请输入手机号码"  style="width: 300px;"></el-input>
            </el-form-item>
            <el-form-item label="入住时间" :label-width="formLabelWidth">
              <el-date-picker
                  v-model="value1"
                  type="date"
                  placeholder="选择日期">
              </el-date-picker>
              <span style="margin: 0 10px;">入住天数</span>
              <el-input-number v-model="num" controls-position="right" @change="handleChange" :min="1" :max="10"></el-input-number>
            </el-form-item>
          </el-form>
        </div>
        <span slot="footer" class="dialog-footer">
    <el-button type="primary" @click="dialogVisible = false" style="margin-right: 50px">入 住</el-button>
    <el-button @click="dialogVisible = false"style="margin-right: 350px">取 消</el-button>
        </span>
      </el-dialog>
      <el-button type="primary">退房</el-button>
      <el-button type="primary">续房</el-button>
      <el-button type="primary">调换</el-button>
      <el-button type="warning">保留</el-button>
      <el-button type="success">取消保留</el-button>
      <el-button type="danger">维护</el-button>
      <el-button type="info">设定房态</el-button>
    </div>
    <!--客房卡片部分-->
    <el-row :gutter="10">
      <el-col :span="3" v-for="u in roomArr" style="margin-top: 50px">
        <el-button
            style="height: 200px;width: 150px;cursor: pointer;text-align: center;font-size: 20px"
            :type="u.color">
          <p style="text-align: center;margin-top:10px;font-size: 30px ">{{ u.num }}</p>
          <p style="text-align: center;margin-top:20px ;font-size: 25px ">{{ u.type }}</p>
          <p style="text-align: center;margin-top:20px ">客户信息:{{ u.person }}</p>
        </el-button>
      </el-col>
    </el-row>
  </div>
</template>
<script>
export default {
  data() {
    return {
      num:'',
      value1: '',
      roomTypeArr: [
        {type: '大床房'},
        {type: '双床房'},
        {type: '电竞房'},
        {type: '亲子房'},
        {type: '豪华房'},
        {type: '经济房'},
      ],
      checked: true,
      dialogTableVisible1: false,
      dialogFormVisible1: false,
      dialogTableVisible2: false,
      dialogFormVisible2: false,
      form: {
        name: '',
        type: '',
        number: ''
      },
      formLabelWidth: '120px',




      dialogVisible: false,
      input: '',
      options: [{
        statusValue: '选项1',
        label: '未入住'
      }, {
        statusValue: '选项2',
        label: '入住'
      }, {
        statusValue: '选项3',
        label: '维护'
      }, {
        statusValue: '选项4',
        label: '保留'
      }],
      options1: [{
        roomValue: '选项1',
        label: '双人房'
      }, {
        roomValue: '选项2',
        label: '大床房'
      }, {
        roomValue: '选项3',
        label: '电竞房'
      }, {
        roomValue: '选项4',
        label: '特价房'
      }, {
        roomValue: '选项5',
        label: '亲子房'
      }, {
        roomValue: '选项6',
        label: '豪华房'
      }],
      statusValue: '',
      roomValue: "",
      roomArr: [
        {id: 1, num: 101, type: "大床房", person: "张一", color: "primary"},
        {id: 2, num: 102, type: "双床房", person: "张2", color: "primary"},
        {id: 3, num: 103, type: "电竞房", person: "张3", color: "primary"},
        {id: 4, num: 104, type: "特价房", person: "张4", color: "warning"},
        {id: 5, num: 105, type: "亲子房", person: "张5", color: "primary"},
        {id: 6, num: 106, type: "豪华房", person: "张6", color: "primary"},
        {id: 7, num: 107, type: "大床房", person: "张7", color: "danger"},
        {id: 8, num: 108, type: "双床房", person: "张8", color: "warning"},
        {id: 9, num: 109, type: "双床房", person: "张一", color: "primary"},
        {id: 10, num: 110, type: "双床房", person: "张2", color: "primary"},
        {id: 11, num: 111, type: "电竞房", person: "张3", color: "primary"},
        {id: 12, num: 112, type: "特价房", person: "张4", color: "warning"},
        {id: 13, num: 113, type: "亲子房", person: "张5", color: "primary"},
        {id: 14, num: 114, type: "豪华房", person: "张6", color: "primary"},
        {id: 15, num: 115, type: "大床房", person: "张7", color: "danger"},
        {id: 16, num: 116, type: "大床房", person: "张一", color: "primary"},
      ],
    }
  },
  methods: {
    handleChange(value) {
      console.log(value);
    },
    handleClose(done) {
      this.$confirm('确认关闭？')
          .then(_ => {
            done();
          })
          .catch(_ => {});
    },
  }
}
</script>
<style>
* {
  margin: 0;
  border: none;
}
</style>